<!-- 基本信息 -->
<div class="monitor-tab-div">
    <div class="m-panel">
    	<div class="m-panel-title">
    		<span>基本信息</span>
    	</div>
    	<div class="m-panel-body base-info-div">
    		<form class="bs-example form-horizontal xs-form">
                <div id="base_info_monitor_div">
                	<div class="form-group">
                        <label class="col-lg-2 control-label">监控器名称：</label>
                        <label class="col-lg-4 control-label tl" data-id="monitorName"></label>
                        <label class="col-lg-2 control-label">监控器类型：</label>
                        <label class="col-lg-4 control-label tl" data-id="monitorTypeName"></label>
                    </div>

                    <div class="form-group">
                        <label class="col-lg-2 control-label">操作系统：</label>
                        <label class="col-lg-4 control-label tl" data-id="osType"></label>
                        <label class="col-lg-2 control-label">系统版本号：</label>
                        <label class="col-lg-4 control-label tl" data-id="osVersion"></label>
                    </div>
                    <div id="base_info_main_div">
                        <div class="form-group">
                            <label class="col-lg-2 control-label">系统位数：</label>
                            <label class="col-lg-4 control-label tl" data-id="osBit"></label>
                            <label class="col-lg-2 control-label">开机时间：</label>
                            <label class="col-lg-4 control-label tl" data-id="bootTime"></label>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">主机名：</label>
                            <label class="col-lg-4 control-label tl" data-id="hostName"></label>
                            <label class="col-lg-2 control-label"></label>
                            <label class="col-lg-4 control-label tl" data-id=""></label>
                        </div>
                    </div>
                    <div id="base_info_assetType_div">
                        <div class="form-group">
                            <label class="col-lg-2 control-label">被监控资产名称：</label>
                            <label class="col-lg-4 control-label tl" data-id="assetName"></label>
                            <label class="col-lg-2 control-label">资产类型：</label>
                            <label class="col-lg-4 control-label tl" data-id="assetTypeName"></label>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">IP：</label>
                            <label class="col-lg-4 control-label tl" data-id="mainIp"></label>
                            <label class="col-lg-2 control-label">业务域：</label>
                            <label class="col-lg-4 control-label tl" data-id="securityDomainName"></label>
                        </div>
                        <div class="form-group">
                        		<label class="col-lg-2 control-label">物理位置：</label>
    	                        <label class="col-lg-4 control-label tl" data-id="locationCbName"></label>
    	                        <label class="col-lg-2 control-label"></label>
    	                        <label class="col-lg-4 control-label tl" data-id=""></label>
                        </div>
                        
                    </div>
                    <div id="base_info_asset_div">
                        <div class="form-group">
                                
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">CPU个数：</label>
                            <label class="col-lg-4 control-label tl" data-id="core"></label>
                            <label class="col-lg-2 control-label">CPU核数：</label>
                            <label class="col-lg-4 control-label tl" data-id="coreNum"></label>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">CPU品牌：</label>
                            <label class="col-lg-4 control-label tl" data-id="brand"></label>

                            <label class="col-lg-2 control-label"></label>
                            <label class="col-lg-4 control-label tl" data-id=""></label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">内存大小：</label>
                        <label class="col-lg-4 control-label tl" data-id="memory"></label>
                        <label class="col-lg-2 control-label"></label>
                        <label class="col-lg-4 control-label tl" data-id=""></label>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">磁盘容量：</label>
                        <label class="col-lg-4 control-label tl" data-id="disk"></label>
                        <label class="col-lg-2 control-label"></label>
                        <label class="col-lg-4 control-label tl" data-id=""></label>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <div class="box">
        <div class="box-item" style="width:30%">
            <!-- 当前使用率-->
            <div class="m-panel">
                <div class="m-panel-title">
                    <span>CPU当前使用信息</span>
                </div>
                <div class="m-panel-body">
                    <div class="monitor-chart box" style="flex-direction:column">
                        <div class="box useage-title">
                            <div class="tc" style="flex:1">
                                <span>1min</span><span id="one_secend">0</span>
                            </div>
                            <div class="tc" style="flex:1">
                                <span>5min</span><span id="five_secend">0</span>
                            </div>
                            <div class="tc" style="flex:1">
                                <span>15min</span><span id="fifteen_secend">0</span>
                            </div>
                        </div>
                        <div class="useage-content" style="flex:1">
                            <div class="box">
                                <div>cpu</div>
                                <div style="flex:1"><div id="cpu_current_use_bg"></div></div>
                                <span style="display: block;line-height: 28px;padding: 0 0 0 5px;" id="cpu_current_use_label"></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="box-item" style="flex:1">
            <!-- CPU使用率-->
            <div class="m-panel">
                <div class="m-panel-title">
                    <span>CPU使用率</span>
                </div>
                <div class="m-panel-body">
                    <div id="cpu_use_line_chart" class="monitor-chart"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="box">
        <div class="box-item" style="width:30%">
            <!-- 内存动态信息 -->
            <div class="m-panel">
                <div class="m-panel-title">
                    <span>内存当前信息</span>
                </div>
                <div class="m-panel-body">
                    <div id="memo_dync_chart" class="monitor-chart box" style="height:210px">
                        <div id="phy_memory_info_div" style="flex:1"></div>
                        <div id="ver_memory_info_div" style="flex:1"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="box-item" style="flex:1">
            <!-- 内存当前使用信息 -->
            <div class="m-panel">
                <div class="m-panel-title">
                    <span>内存使用率</span>
                </div>
                <div class="m-panel-body">
                    <div id="memory_use_line_chart" class="monitor-chart" style="height:210px"></div>
                </div>
            </div>
        </div>
    </div>

    <!-- 磁盘动态信息 -->
    <div class="m-panel">
    	<div class="m-panel-title">
    		<span>磁盘动态信息</span>
    	</div>
    	<div class="m-panel-body">
    		<div id="disk_use_chart" class="monitor-chart clearfix" style="height:auto;min-height:100px;"></div>
    	</div>
    </div>

    <!-- 系统信息 -->
    <div class="m-panel">
    	<div class="m-panel-title">
    		<span>系统信息</span>
    	</div>
    	<div class="m-panel-body" id="system_info_div">
    		<div class="m-panel-body-card">
    			<ul>
                    <!-- 
    				<li class="active" data-action="io_list">磁盘IO</li>
    				<li data-action="node_list">补丁</li>
                    -->
    				<li class="active" data-action="network_list">网卡</li>
    				<li data-action="system_process_list">系统进程动态</li>
    			</ul>
    		</div>
    		<div id="sys_process_sel" style="display: none;">
                <form class="bs-example form-horizontal xs-form">
                    <div class="form-group">
                        <label class="col-lg-2 control-label">使用用户：</label>
                        <div class="col-lg-2 mt5 mb5" id="user_div">
                            <select class="form-control input-sm" data-type="select"
                                data-flag="process_sel" id="user_el">
                            </select>
                        </div>
                        <label class="col-lg-2 control-label" style="width:130px;">映像名称：</label>
                        <div class="col-lg-2 mt5 mb5" id="name_div">
                            <select class="form-control input-sm" data-type="select"
                                data-flag="process_sel" id="name_el">
                            </select>
                        </div>
                        <label class="col-lg-2 control-label" style="width:130px;">排序查询：</label>
                        <div class="col-lg-2 mt5 mb5" id="query_div">
                            <select class="form-control input-sm" data-type="select"
                                data-flag="process_sel" disabled id="query_el">
                                <option value="----">----</option>
                                <option value="mem_usage">内存使用率</option>
                                <option value="cpu_usage">CPU使用率</option>
                            </select>
                        </div>
                    </div>
                </form>
            </div>
    		<div class="table-div" id="system_info_table" style="height:300px"></div>
    	</div>
    </div>

    <!-- 接口面板 -->
    <div class="m-panel">
        <div class="m-panel-title">
            <span>接口面板</span>
        </div>
        <div class="m-panel-body" style="height:auto;min-height:350px;">
            <div id="interface_info" class="col-lg-12 h-all"></div>
        </div>
    </div>
</div>

<div class="monitor-tab-div" data-type="event"></div>

<tem id="tem">
    <!-- 关键字详情模板 -->
    <div class="template" id="keyword_detail_tem">
        <span>文件路径：</span><label data-id="filePath"></label>
        <div class="table_div mt10" id="keyword_detail_list_div" style="height:300px" validate="required,path"></div>
    </div>
    <!-- 匹配结果详情模板 -->
    <div class="template" id="result_detail_tem">
        <span>文件路径：</span><label data-id="filePath"></label>
        <div class="table_div mt10" id="result_detail_list_div" style="height:300px" validate="required,path"></div>
    </div>
    <!-- 日志文件关键字编辑模板 -->
    <div class="template" id="config_edit_template">
        <div class="panel-body no-tb-padder">
            <form class="bs-example form-horizontal xs-form" id="query_form">
                <div class="form-group">
                    <label class="col-lg-2 control-label required">文件路径</label>
                    <div class="col-lg-8">      
                        <input type="hidden" data-id="keywordId">
                        <input type="text" class="form-control input-sm" maxlength="256" data-id="filePath" validate="required,path">
                    </div>      
                </div>

                <div class="form-group">
                    <div class="col-lg-6">
                        <!-- 右移箭头 -->
                        <div style="right:20px;top:20px;font-size:20px;z-index:2000" 
                                id="chevron-right" class="pabs square">
                            <i class="icon-chevron-right"></i>
                        </div>
                        <!-- 左移箭头 -->
                        <div style="right:20px;top:60px;font-size:20px;z-index:2000" 
                                id="chevron-left" class="pabs square">
                            <i class="icon-chevron-left" ></i>
                        </div>
                        <div id="form-left-div">
                            <div class="form-group">
                                <label class="col-lg-4 control-label required">关键字</label>
                                <div class="col-lg-6">
                                    <input type="text" class="form-control input-sm"
                                        data-flag="keywordName">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-lg-4 control-label">匹配原则</label>
                                <div class="col-lg-6">
                                    <select class="form-control input-sm" data-flag="fileRule" data-type="select">
                                        <option value=">"> > </option>
                                        <option value="="> = </option>
                                        <option value="<"> < </option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-lg-4 control-label required">次数</label>
                                <div class="col-lg-6">
                                    <input type="text" class="form-control input-sm"
                                        data-flag="times" validate="number">
                                </div>          
                            </div>
                        </div>
                    </div>

                    <div class="col-lg-6">
                        <div class="table_div" id="config_edit_table" style="height:260px"></div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</tem>

<script type="text/javascript">
$(document).ready(function (){
require([index_web_app_name + '/js/plugin/monitor/catagory/windows.js'] ,function (windows){

var urlParamObj = index_query_param_get()

view_init()

event_init()

index_form_init($("#sys_process_sel"));

function view_init()
{
	urlParamObj.time = $("#query_time_label").text()
    urlParamObj.edId = urlParamObj.assetId
    windows.base_info_render(urlParamObj)
    windows.cpu_info_chart(urlParamObj);
    windows.cpu_use_chart($("#cpu_use_line_chart") ,urlParamObj)
    windows.memory_info_chart($("#phy_memory_info_div") ,$("#ver_memory_info_div") ,urlParamObj)
    windows.memory_use_chart($("#memory_use_line_chart") ,urlParamObj)
	system_info()
	windows.first_disk_chart($("#disk_use_chart") ,urlParamObj)
    windows.interface_render($("#interface_info") ,urlParamObj)
}

function event_init(){
    $("[data-flag=process_sel]").change(function (){
        windows.system_process_list($("#system_info_table") ,urlParamObj)
    });

    var user_select_url = "monitorview/os/windows/queryUsernameStore";
    var name_select_url = "monitorview/os/windows/queryImagenameStore";

    um_ajax_get({
        url : user_select_url,
        isLoad : false,
        paramObj : urlParamObj,
        successCallBack : function (data){
            var selBuff = [];
            for (var i = 0; i < data.length; i++) {
                selBuff.push({id:data[i].codevalue ,text:data[i].codename});
            }
            $("#user_el").select2({
                  data: selBuff,
                  width:"100%"
            });
            um_ajax_get({
                url : name_select_url,
                paramObj : urlParamObj,
                isLoad : false,
                successCallBack : function (data){
                    var selBuff = [];
                    for (var i = 0; i < data.length; i++) {
                        selBuff.push({id:data[i].codevalue ,text:data[i].codename});
                    }
                    $("#name_el").select2({
                          data: selBuff,
                          width:"100%"
                    });
                }
            });
        }
    });
}

window.index_monitor_init = function ()
{
	view_init()
}

// 系统信息
function system_info(){
    var el_ul = $("#system_info_div").find("ul")
    el_ul.find("li").unbind("click")
    el_ul.find("li").click(function (){
        $("#sys_process_sel").hide()
        $(this).siblings().removeClass("active")
        $(this).addClass("active")
        if ($(this).attr("data-action") == "system_process_list")
            $("#sys_process_sel").show()
        windows[$(this).attr("data-action")]($("#system_info_table") ,urlParamObj)
    })

    windows.network_list($("#system_info_table") ,urlParamObj)
}


});
});
</script>